home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Mail / pine3.92 / pico / os_unix.h < prev    next >
C/C++ Source or Header  |  1996-03-17  |  4KB  |  189 lines

  1. /*
  2.  * $Id: os_unix.h,v 4.32 1996/03/17 23:02:46 mikes Exp $
  3.  *
  4.  * Program:    Operating system dependent routines - Ultrix 4.1
  5.  *
  6.  *
  7.  * Michael Seibel
  8.  * Networks and Distributed Computing
  9.  * Computing and Communications
  10.  * University of Washington
  11.  * Administration Builiding, AG-44
  12.  * Seattle, Washington, 98195, USA
  13.  * Internet: mikes@cac.washington.edu
  14.  *
  15.  * Please address all bugs and comments to "pine-bugs@cac.washington.edu"
  16.  *
  17.  *
  18.  * Pine and Pico are registered trademarks of the University of Washington.
  19.  * No commercial use of these trademarks may be made without prior written
  20.  * permission of the University of Washington.
  21.  * 
  22.  * Pine, Pico, and Pilot software and its included text are Copyright
  23.  * 1989-1996 by the University of Washington.
  24.  * 
  25.  * The full text of our legal notices is contained in the file called
  26.  * CPYRIGHT, included with this distribution.
  27.  */
  28.  
  29. #ifndef    OSDEP_H
  30. #define    OSDEP_H
  31.  
  32. #if    defined(dyn) || defined(AUX)
  33. #include    <strings.h>
  34. #else
  35. #include    <string.h>
  36. #endif
  37.  
  38. #undef    CTRL
  39. #include    <signal.h>
  40. #if    defined (ptx) || defined(sv4)
  41. /* DYNIX/ptx signal semantics are AT&T/POSIX; the sigset() call sets
  42.    the handler permanently, more like BSD signal(). */
  43. #define signal(s,f) sigset (s, f)
  44. #endif
  45.  
  46. /* signal handling is broken in the delivered SCO shells, so punt on 
  47.    suspending the current session */
  48. #if defined(sco) && defined(SIGTSTP)
  49. #undef SIGTSTP
  50. #endif
  51.  
  52. #include    <ctype.h>
  53. #include    <sys/types.h>
  54.  
  55. #if    defined(POSIX) || defined(aix) || defined(COHERENT) || defined(isc) || defined(sv3) || defined(asv)
  56. #include    <dirent.h>
  57. #else
  58. #include    <sys/dir.h>
  59. #endif
  60.  
  61. #if    defined(asv)
  62. #include    <sys/socket.h>  /* for fd_set */
  63. extern struct passwd *getpwnam();
  64. extern struct passwd *getpwuid();
  65. #endif
  66.  
  67. #if    defined(sco)
  68. #include    <sys/stream.h>
  69. #include    <sys/ptem.h>
  70. #endif
  71.  
  72. #include    <sys/stat.h>
  73.  
  74. #if    defined(asv) || defined(bsd)
  75. extern int stat();
  76. #endif
  77.  
  78. /*
  79.  * 3b1 definition requirements
  80.  */
  81. #if    defined(ct)
  82. #define opendir(dn)    fopen(dn, "r")
  83. #define closedir(dirp)    fclose(dirp)
  84. typedef struct
  85.     {
  86.     int    dd_fd;            /* file descriptor */
  87.     int    dd_loc;            /* offset in block */
  88.     int    dd_size;        /* amount of valid data */
  89.     char    *dd_buf;        /* directory block */
  90.     }    DIR;            /* stream data from opendir() */
  91. #endif
  92.  
  93. /* Machine/OS definition            */
  94. #if    defined(ptx) || defined(sgi) || defined(sv4) || defined(sco)
  95. #define TERMINFO    1               /* Use TERMINFO                  */
  96. #else
  97. #define TERMCAP        1               /* Use TERMCAP                  */
  98. #endif
  99.  
  100. /*
  101.  * type qsort() expects
  102.  */
  103. #if    defined(nxt) || defined(neb)
  104. #define    QSType      void
  105. #define QcompType const void
  106. #else
  107. #if    defined(hpp)
  108. #define    QSType      void
  109. #define QcompType void
  110. #else
  111. #define    QSType      int
  112. #define QcompType void
  113. #endif
  114. #endif
  115.  
  116. /*
  117.  * File name separator, as a char and string
  118.  */
  119. #define    C_FILESEP    '/'
  120. #define    S_FILESEP    "/"
  121.  
  122. /*
  123.  * Place where mail gets delivered (for pico's new mail checking)
  124.  */
  125. #if    defined(sv3) || defined(ct) || defined(isc) || defined(AUX) || defined(sgi)
  126. #define    MAILDIR        "/usr/mail"
  127. #else
  128. #define    MAILDIR        "/usr/spool/mail"
  129. #endif
  130.  
  131.  
  132. /*
  133.  * What and where the tool that checks spelling is located.  If this is
  134.  * undefined, then the spelling checker is not compiled into pico.
  135.  */
  136. #if    defined(COHERENT) || defined(AUX)
  137. #define SPELLER         "/bin/spell"
  138. #else
  139. #define    SPELLER        "/usr/bin/spell"
  140. #endif
  141.  
  142. /* memcpy() is no good for overlapping blocks.  If that's a problem, use
  143.  * the memmove() in ../c-client
  144.  */
  145. #if    defined (ptx) || defined(sv4) || defined(sco) || defined(isc) || defined(AUX)
  146. #define bcopy(a,b,s) memcpy (b, a, s)
  147. #endif
  148.  
  149. /* memmove() is a built-in for AIX 3.2 xlc. */
  150. #if    defined (a32) || defined(COHERENT)
  151. #define bcopy(a,b,s) memmove (b, a, s)
  152. #endif
  153.  
  154. #if    defined(dyn)
  155. #define    strchr    index            /* Dynix doesn't know about strchr */
  156. #define    strrchr    rindex
  157. #endif    /* dyn */
  158.  
  159. #ifdef    MOUSE
  160. #define    XTERM_MOUSE_ON    "\033[?1000h"    /* DECSET with parm 1000 */
  161. #define    XTERM_MOUSE_OFF    "\033[?1000l"    /* DECRST with parm 1000  */
  162. #endif
  163.  
  164. #if    defined(bsd) || defined(nxt) || defined(dyn)
  165. #ifdef    ANSI
  166. extern char *getcwd(char *, int);
  167. #else
  168. extern char *getcwd();
  169. #endif
  170. #endif
  171.  
  172. #if    defined(COHERENT)
  173. #define void char
  174. #endif
  175.  
  176. /*
  177.  * Mode passed chmod() to make tmp files exclusively user read/write-able
  178.  */
  179. #define    MODE_READONLY    (0600)
  180.  
  181.  
  182. /*
  183.  * Default terminal dimensions...
  184.  */
  185. #define    NROW    24
  186. #define    NCOL    80
  187.  
  188. #endif    /* OSDEP_H */
  189.